#include <hardware/relay/relay.h>

void initRelay()
{
    pinMode(RELAY, OUTPUT);
    closeRelay();
}

void openRelay()
{
    digitalWrite(RELAY, LOW);
}

void closeRelay()
{
    digitalWrite(RELAY, HIGH);
}

void setRelayState(unsigned char value)
{
    relayState = value;
    return;
}

void switchRelay()
{
    if (relayState == 1)
    {
        openRelay();
    }
    else
    {
        closeRelay();
    }
}